import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/material/product/getList',
    method: 'post',
    data: query
  })
}

export function fetchArticle(id) {
  return request({
    url: '/material/product/getDetail',
    method: 'post',
    data: { id }
  })
}

export function removeProductByID(productID) {
  return request({
    url: '/material/product/delete',
    method: 'post',
    data: {
      'product_identity': productID
    }
  })
}

export function createArticle(data) {
  return request({
    url: '/material/product/save',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/material/product/save',
    method: 'post',
    data
  })
}
